<table id="datagrid_${action_id}" ></table>
<script type="text/javascript">
$(function(){

	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		singleSelect:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/agency/group-datagrid.json',
		sortName: 'name',
		sortOrder: 'desc',
		remoteSort: true,
		idField:'id',
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
					//{field:'ck',checkbox:true},
					{field:'id',title:'编号',width:40,align:'center',sortable:true},
					{field:'name',title:'名称',width:40,align:'center',sortable:true},
					{field:'descriptions',title:'描述',width:80,align:'center',sortable:true},
					{field:'agency',title:'类型',width:80,align:'center',formatter:function(val, rec){
						if(rec.agency!=null){
							return '用户级';
						}else{
							return '系统级';
						}
					}}
				]],
		pagination:true,
		rownumbers:true,
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}}
	});

});


</script>	